<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" href="css/base.css" type="text/css" />
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
	$(function(){
		
		$('.submit').click(function(){
			var name = $('.name'); 
			var intro = $('.intro');
			if (! name.val()) {
				$('.error_text').html("班级名称不能为空");
				return false;
			}
			
			if (!intro.val()) {
				$('.error_text').html("班级简介不能为空");
				return false;
			}
			var fid = <%=request.getAttribute("id")%>;
			
			//异步提交数据
			 $.ajax({
				url:"class_update.action?id="+fid,
				type:"post",
				data:{
					"name":name.val(),
					"intro":intro.val()
				},
				success:function(data){
					window.location.href="class_show.action";	
				}
			}) 
		});
	});
</script>


</head>

<body>
		<div class="main_right_top">您现在所在位置 > <span>添加课程信息</span></div>
		<div class="main_right_body"> 
        <div class="body_content">
        	<div class="add_xm_all">
            	<h1 class="add_xm_top">
                	基本信息
                </h1><!--add_xm_top-->
            	<div class="add_xm_form">
                	<ul>
                        <li>
                            <label>班级名称：</label>
                            <input type="text" class="name" value="${classPO.class_name}"/>	
                            <span class="error_text"></span>			
                        </li>
                        
                        <li>
                            <label>班级简介：</label>
                            <input type="text" class="intro" value="${classPO.class_content}"/>	
                            <span class="error_text"></span>			
                        </li>
                    </ul>
                    <div class="regist_btn">
                        <input type="submit" value="提交" class="submit" />
                        <a class="return_btn">返回</a>
                    </div>
                </div><!--add_xm_form-->
            </div><!--add_xm_all-->
       </div>	
	</div> <!--main_right_body-->
	
</body>
</html>